﻿@model NK.Mvc3.Models.StoreInputDetail
           
@using (Ajax.BeginForm("AjaxCreate", "StoreInputDetail", null, new AjaxOptions
{
    HttpMethod = "POST",
    InsertionMode = InsertionMode.InsertBefore,
    UpdateTargetId = "gridbody",
    OnSuccess = "clearData(this)"
}, new { @id = "ajaxcreateform"}))
 {

         <div class="gridcell">
             @Html.TextBox("dtupdateBarCode", null, new { @class = "grid-textbox-text",
                                                        onchange = "changeBarCode(this,'hdProductInfoID','dtupdatePOSDescription')"})
             @Html.ValidationMessage("dtupdateBarCode")
             @*@Html.HiddenFor(model => model.ID)*@
        
             @Html.HiddenFor(model => model.StoreInputID, new { Value = ViewBag.StoreInputID, id = "hdStoreInputID" })
             @Html.ValidationMessageFor(model => model.StoreInputID)

             @Html.HiddenFor(model => model.ProductInfoID, new {id = "hdProductInfoID"})
             @Html.ValidationMessageFor(model => model.ProductInfoID)
         </div>
    
         <div class="gridcell">
             @Html.TextBox("dtupdatePOSDescription", null, new {@class = "grid-textbox-text", disabled = "disabled"})
         </div>
    
         <div class="gridcell">
             @Html.TextBoxFor(model => model.Quantity, new {@class = "grid-textbox-num"})
             @Html.ValidationMessageFor(model => model.Quantity)
         </div>
    
         <div class="gridcell">
             @Html.TextBoxFor(model => model.ExpireDate, new {@class = "grid-textbox-date"})
             @Html.ValidationMessageFor(model => model.ExpireDate)
         </div>
    
         <div class="gridcell">
             @Html.TextBoxFor(model => model.FreeQuantity, new {@class = "grid-textbox-num"})
             @Html.ValidationMessageFor(model => model.FreeQuantity)
         </div>
    
         <div class="gridcell">
             @Html.TextBoxFor(model => model.CostInput, new {@class = "grid-textbox-num"})
             @Html.ValidationMessageFor(model => model.CostInput)
         </div>
    
         <div class="gridcell">
             @Html.TextBoxFor(model => model.TotalCost, new {@class = "grid-textbox-num"})
             @Html.ValidationMessageFor(model => model.TotalCost)
         </div>
    
         <div class="gridcell action">
             <input type="submit" value="Insert" />
         </div>
 }
    
<script type="text/javascript">
    //$(function () {
        //                $.validator.unobtrusive.parse("#ajaxcreateform");
        //        $.validator.unobtrusive.parse();
        //        $.ajaxSetup({ cache: false });
        //        $("input[type=submit]").click(function () {
        //            alert("submit");
        //            if (!$('#ajaxcreateform').valid()) {
        //                alert("invalid");
        //                return false;
        //            }
        //        });

   // });
</script>